<?php
/**
 * 商会通讯录模块定义
 *
 * @author zh0537cn
 * @url http://s.we7.cc/
 */
defined('IN_IA') or exit('Access Denied');

global $_W, $_GPC;

load()->func('tpl');

$opp = 'setup';

$uniacid = $_W['uniacid'];

$deat = pdo_fetch("SELECT * FROM " . tablename('bbyscm_card_sysset') . ' where `uniacid`=:uniacid limit 1', array(':uniacid' => $uniacid));

if (checksubmit('submit')) {
    $data['copyright'] = $_GPC['copyright'];
    $data['systel'] = $_GPC['systel'];
    $data['copyright'] = $_GPC['copyright'];
    $data['systel'] = $_GPC['systel'];
	$data['sysopenid'] = $_GPC['sysopenid'];
	$data['apikey'] = $_GPC['apikey'];
	$data['AppCode'] = $_GPC['AppCode'];
	$data['AppCodek'] = $_GPC['AppCodek'];
	$data['appid'] = $_GPC['appid'];
    $data['appsecret'] = $_GPC['appsecret'];
	$data['mchid'] = $_GPC['mchid'];
	$data['wxkey'] = $_GPC['wxkey'];
	$data['gun_key'] = $_GPC['gun_key'];
	$data['share_money'] = $_GPC['share_money'];
    if ($_GPC['fxtext']){
		$data['fxtext'] = $_GPC['fxtext'];
		}else{
			$data['fxtext'] = '快来创建属于自己名片吧！这是';
			}
	if ($_GPC['fxtexth']){
		$data['fxtexth'] = $_GPC['fxtexth'];
		}else{
			$data['fxtexth'] = '的名片！请惠存！';
			}
	if ($_GPC['shtexth']){
		$data['shtexth'] = $_GPC['shtexth'];
		}else{
			$data['shtexth'] = '点击分享可排名提前和增加积分哦！';
			}
	if ($_GPC['z_company']){
		$data['z_company'] = $_GPC['z_company'];
		}else{
			$data['z_company'] = '公司';
			}
	if ($_GPC['z_job']){
		$data['z_job'] = $_GPC['z_job'];
		}else{
			$data['z_job'] = '职务';
			}
	if ($_GPC['z_indus']){
		$data['z_indus'] = $_GPC['z_indus'];
		}else{
			$data['z_indus'] = '行业';
			}
	if ($_GPC['explaina']){
		$data['explaina'] = $_GPC['explaina'];
		}else{
			$data['explaina'] = '使用帮助，如何使用名片';
			}
	if ($_GPC['explainb']){
		$data['explainb'] = $_GPC['explainb'];
		}else{
			$data['explainb'] = '同学通讯录、战友通讯录、公司内部通讯录等！保密性好！不公开名片通讯录只有内部成员间可见！';
			}
	if ($_GPC['explainc']){
		$data['explainc'] = $_GPC['explainc'];
		}else{
			$data['explainc'] = '如何使用个人中心功能';
			}			
	
	$data['mobileto'] = $_GPC['mobileto'];
	$data['audio'] = $_GPC['audio'];
	$data['service'] = $_GPC['service'];
	$data['home_service'] = $_GPC['home_service'];
	$data['to_examine'] = $_GPC['to_examine'];
	
 if (empty($deat)) {
	 
        $data['uniacid'] = $uniacid;
		
        pdo_insert('bbyscm_card_sysset', $data);
		
    } else {
		
        pdo_update('bbyscm_card_sysset', $data, array('uniacid' => $uniacid));
		
    }
	if (!isset($settings['job1'])) {
			$settings['job1'] = '总裁,总经理,副总经理,财务总监,营销总监,技术总监,助理,职员';
		}
		if (checksubmit()) {
			$cfg = array('job1' => $_GPC['job1']);
			$this->saveSettings($cfg);
		}
		message('更新参数设置成功！', 'refresh');
}

include $this->template('web/setup');
